<template>
 <view >
<view class="steganogram">
	<formData :values="values" :fields="fields" :rules="rules" ref="FormData" labelAlign="left">
	</formData>
</view>
<view class="button_error d-f-j-c-a-i " @click="disembark">
			确认修改
		</view>
		<u-toast ref="uToast"></u-toast>
 </view>
</template>

<script>
	import formData from '@/components/form/index'
	import {
		mapState,mapMutations,
		mapActions
	} from 'vuex'
 export default {
   data () {
     return {

     }
   },
   components: {
formData
   },
   methods: {
	   ...mapActions({
		cryptogram:'PERSONAL/CRYPTOGRAM'   
	   }),
    disembark(){
		let _this=this
		let flag=false
		 flag=this.$refs.FormData.submit()
		if(flag){
		if (this.values.new_pwd != this.values.query_pwd) {
			this.$u.toast('两次密码不一致');
			return
		}	
		uni.showModal({
		    title: '提示',
		    content: '是否确定要修改密码?',
		    success: function (res) {
		        if (res.confirm) {
					
		       _this.cryptogram()
		        } 
		    }
		});
		}
		
	}
   },
   mounted() {

   },
   watch: {

   },
   computed: {
   ...mapState({
	  values:(state)=>state.PERSONAL.values ,
	  fields:(state)=>state.PERSONAL.fields ,
	  rules:(state)=>state.PERSONAL.rules ,
	  
   })
   }
 }
</script>

<style scoped lang='scss'>
.steganogram{
	padding: 0rpx 32rpx;
		height: 1024rpx;
}
.button_error {
		width: 686rpx;
		height: 100rpx;
		background: #409AFF;
		border-radius: 50rpx;
		font-size: 32rpx;
		color: #FFF;
		margin-top: 94rpx;
		margin-left: 32rpx;
	}
</style>

<style>
page{
    background: #FAFAFA;
}
	
</style>